<template>
  <div id="exportFile">
    <SearchForm v-model="ruleForm" :dataJ="dataJ" @search-form="searchForm" />
    <BkTable
      :tableHead="tableJ"
      :tableData="tableData"
      :total="total"
      :page="page"
      @getList="getList"
    />
  </div>
</template>

<script>
import { getCarList } from "@/api/api";
export default {
  name: "exportFile",
  data() {
    return {
      ruleForm: {},
      tableData: [{}],
      page: {
        pageNum: 1,
        pageSize: 10,
      },
      total: 0,
    };
  },
  computed: {
    dataJ() {
      return [
        {
          label: "文件名",
          prop: "fileName",
          type: "input",
        },
        {
          label: "导出状态",
          prop: "status",
          type: "select",
          options: [],
        },
        {
          label: "所属科室",
          prop: "status",
          type: "select",
          options: [],
        },
        {
          label: "申请人",
          prop: "fileName",
          type: "input",
        },
        {
          label: "导出时间",
          prop: "date",
          type: "daterange",
        },
      ];
    },
    tableJ() {
      return [
        {
          prop: "roleName",
          label: "导出文件名称",
          sortable: false,
        },
        {
          prop: "roleDesc",
          label: "导出任务名称",
          sortable: false,
        },
        {
          prop: "createTime",
          label: "关联专病库",
          sortable: false,
        },
        {
          prop: "createTime",
          label: "病例数",
          sortable: false,
        },
        {
          prop: "createTime",
          label: "导出状态",
          sortable: false,
        },
        {
          prop: "createTime",
          label: "申请人",
          sortable: false,
        },
        {
          prop: "createTime",
          label: "所属科室",
          sortable: false,
        },
        {
          prop: "createTime",
          label: "导出开始时间",
          sortable: false,
        },
        {
          prop: "createTime",
          label: "导出结束时间",
          sortable: false,
        },
        {
          prop: "createTime",
          label: "任务执行信息",
          sortable: false,
        },
        {
          label: "操作",
          width: "100px",
          btnList: [
            {
              name: "下载文件",
              type: "text",
              isShow: (row) => {
                return false;
              },
              handleClick: (val) => {
                this.id = val.id;
                this.roleName = val.roleName;
                this.roleDesc = val.roleDesc;
                this.singleDetail(val);
              },
            },
            {
              name: "重新执行",
              type: "text",
              // isShow: (row) => {
              //   return false;
              // },
              handleClick: (val) => {
                this.editData(val);
              },
            },
            {
              name: "-",
              type: "text",
              btnClass: "no-handle",
              isShow: (row) => {
                return true;
              },
            },
          ],
        },
      ];
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    searchForm() {
      this.getList();
    },
    getList() {},
    async editData() {
      await getCarList({
        rdrName: "RDR_01",
        hotSize: 4,
      });
    },
  },
};
</script>

<style scoped lang="less">
#exportFile {
  padding: 0 0.2rem;
  background: #fff;
}
</style>
